<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 <link rel="stylesheet" href="model.css" />
   <?php include("head.php"); ?>
 <?php include("entete.php"); ?>
   <?php include("menu.php"); ?>
<?php
  <?php


try{
  $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
  $bdd = new PDO('mysql:host='.DB_SERVER.';dbname='.DB_DATABASE, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, $pdo_options);
 
  //récupération de la variable d'URL,
  //qui va nous permettre de savoir quel enregistrement modifier
  $id_adherent  = $_POST["id_adherent"] ;
  $nom =$_POST["nom"];
  $prenom =$_POST["prenom"];
  $filiere  = $_POST["filiere"] ;
  $annee  = $_POST["annee"] ;
  $login =$_POST["login"];
  $mdp =$_POST["mdp"];
  $mail =$_POST["mail"];
  $paye =$_POST["paye"];
  $id_assoc =$_POST["id_assoc"];

  $sql = "UPDATE ADHERENT 
SET FILIERE = '$filiere', 
ANNEE = '$annee',
LOGIN = '$login',
MDP = '$mdp',
MAIL = '$mail'
WHERE ID_ADHERENT = '$id_adherent'";

  //requête SQL:

 $bdd->exec($sql);

$sql = "UPDATE COTISATION
SET PAYE = '$paye'
WHERE ID_ADHERENT = '$id_adherent' 
AND ID_ASSOC = '$id_assoc'";

 $bdd->exec($sql);

 echo $nom.' '.$prenom.' a bien été modifié.';
}
catch (Exception $e)
{
  die('Erreur : ' . $e->getMessage());
} 
?>


 <?php include("pied_de_page.php"); ?>